package com.example.socketdemo.controller;

import com.example.socketdemo.socket.MyWebSocket;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    private MyWebSocket myWebSocket;

    @RequestMapping(value = "hello")
    public String hello(String msg) {
        myWebSocket.sendMessage(msg, null);
        return "success";
    }
}
